<?php

include "koneksi.php";

$response = array();
  
    $id_member = $_POST['id_member'];
	$namalengkap = $_POST['namalengkap'];
	$tanggallahir = $_POST['tanggallahir'];
	$jekel = $_POST['jekel'];
	$gol = $_POST['gol'];

	$cek_member = mysql_query("SELECT * FROM member WHERE id_member='$id_member' AND namalengkap='$namalengkap' AND tgl_lahir='$tanggallahir' AND jenis_kelamin='$jekel' AND gol_darah='$gol' ");
	
	if(mysql_num_rows($cek_member) == 1){
	
		$q = mysql_query('UPDATE member SET aktifasi = "ACTIVE" WHERE id_member ="'.$id_member.'"');
	
		$r = mysql_fetch_array($cek_member);
		
		$response["hasil"] = 1;
		$response["id_member"] = $r["id_member"];
		$response["pesan"] = "Aktifasi Berhasil.";

		echo json_encode($response);
	
	}
	else{
	
		$response["hasil"] = 0;
		$response["pesan"] = "Aktifasi Gagal.";
		
		echo json_encode($response);

	}

?>